﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MC.RideEvent.Mvc.Models.ViewModel
{
    public class WayViewModel
    {
        #region Constructors
        public WayViewModel(){}
        #endregion

        public int Id { get; set; }
        public string CodeWay { get; set; }

        public int DriverId { get; set; }
        public int EventId { get; set; }
        public EventViewModel Event{ get; set; }
        public int VehiculeId { get; set; }

        [Required(ErrorMessage = "*")]
        [Display(Name = "Participation")]
        [DataType(DataType.Currency)]
        public int Contribution { get; set; }

        [Required(ErrorMessage = "*")]
        [Display(Name = "Heure rendez-vous")]
        [RegularExpression("^[0-2]?[0-3]:[0-5][0-9]$", ErrorMessage = "Le format de l'heure est incorrect.")]
        public string MeetingHour { get; set; }

        [Required(ErrorMessage = "*")]
        [Display(Name = "Lieu rendez-vous")]
        public string  MeetingPlace { get; set; }

        [Required(ErrorMessage = "*")]
        [Display(Name = "Places disponibles")]
        public int NumberPlaces { get; set; }

        #region Complementary informations
        public string City { get; set; }
        public string NamePlace { get; set; }
        public DateTime DateEvent { get; set; }

        /// <summary>
        /// Utiliser pour le detail d'un trajet (pour les membres)
        /// </summary>
        public MemberViewModel Driver { get; set; }

        [UIHint("DDLVehiculeMemberKendo")]
        public CarModel Car { get; set; }

        [UIHint("DDLVehiculeMemberKendo")]
        public VehiculeViewModel Vehicule { get; set; }

        #endregion
    }
}